<%-- 
    Document   : newreleasespane
    Created on : Jul 28, 2012, 12:46:12 PM
    Author     : Atienza-Home
--%>

<%@page import="Functions.ProgramFunction"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.Iterator"%>
<%@page import="Factory.Tables.Movie"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%

    ArrayList<Movie> result = (ArrayList<Movie>)session.getAttribute("newmovies");
    Iterator<Movie> iter;
    Movie movie;
    
    int i=0;
    
   if(result!=null){
       iter = result.iterator(); 
       movie=iter.next();
       i++;

%>
<br>
<div id="newestmoviepane" style="border:15px solid #006666;margin: auto;width: 790px;height: 514px;" >
    <div style="position:absolute;margin:0;">
        <div style="background-color: #006666;padding-left: 5px;padding-right:5px;opacity:0.8;filter:alpha(opacity=80);">
            <font color="white"><%=ProgramFunction.convertMySQLDateFormatToWebDateFormat(movie.getReleaseDate().toString() )%></font>
                
        </div>
            
    </div>
    <div style="position:absolute;margin-left:705px;margin-top: 420px;background-color: #006666;width:100px;">
        <div style="padding-left: 5px;padding-right:5px">
            <font color="white"><a href="movie.jsp?id=<%=movie.getId() %>" style="color:white">See more!</a></font>
                
        </div>
            
    </div>
    <div id="newestmoviepic" >
        
        
        
        <div style="background-color: black;width: 790px;height:444px;text-align: center;">
            <img style="max-width:790px;max-height:444px;" src="images/movie/<%=movie.getMoviePic()%>"/>
        </div>
	<div id="newestmoviedesc" style="text-align: center;padding-top:20px;width:790px;height:50px;">
             <font color="white"><%=movie.getName()%></font>
	</div>
        
    </div>
    
 </div>   
        <br>
    <div style=" width:840px;margin:auto;">
        <%
            
                while(iter.hasNext() && i<10){
                    movie = iter.next();
                    
                    if(i%3==1 && i!=1 ){
                        %>
                        
                            <br><br><br><br><br><br><br><br><br><br><br><br>
                            
                            
                        
                        <%
                    }
                    
            %>
            
            <div style="float: left;width: 280px;height: 230px;">
                <div style="border:15px solid #006666;margin: auto;width:230px;height:184px;">
                    <div style="position:absolute;margin:0;">
                        <div style="background-color: #006666;padding-left: 5px;padding-right:5px;opacity:0.8;filter:alpha(opacity=80);">
                            <font color="white"><%=ProgramFunction.convertMySQLDateFormatToWebDateFormat(movie.getReleaseDate().toString() )%></font>
                
                        </div>
            
                    </div>
                    <div style="position:absolute;margin-left:145px;margin-top: 126px;background-color: #006666;width:100px;">
                        <div style="padding-left: 5px;padding-right:5px">
                            <font color="white"><a href="movie.jsp?id=<%=movie.getId() %>" style="color:white">See more!</a></font>
                
                        </div>
            
                    </div>
                    <div>
        
        
        
                        <div style="background-color: black;width: 230px;height:150px;text-align: center;">
                            <img style="max-width:230px;max-height:150px;" src="images/movie/<%=movie.getMoviePic()%>"/>
                        </div>
                        <div id="newestmoviedesc" style="text-align: center;padding-top:5px;width:230px;height:20px;">
                            <font color="white"><%=movie.getName()%></font>
                        </div>
        
                    </div>
                    
                    
                    
                </div> 
            
        
      
            </div>
            
            <%
            
            i++;
            
            
                }
                        %>
                        
                            <br><br><br><br><br><br><br><br><br><br><br><br>
                            
                            
                        
                        <%
            
                
            }
        
    %>
    
            
    </div>
        
        

    
